# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: rfaa <rfaa@rfaa.se>
pkgname=raylib-wayland
pkgver=3.0.0
pkgrel=0
pkgdesc="Raylib game programming library (Wayland)"
url="https://www.raylib.com/"
arch="all !armhf" # Limited by glfw-wayland
license="Zlib"
depends="glfw-wayland"
depends_dev="glfw-wayland-dev"
makedepends="$depends_dev cmake"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/raysan5/raylib/archive/$pkgver.tar.gz"
builddir="$srcdir/raylib-$pkgver"
options="!check" # no tests included

build() {
	cmake -B build \
		-Wno-dev \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DUSE_EXTERNAL_GLFW=ON \
		-DSTATIC=OFF \
		-DSHARED=ON \
		-DWITH_PIC=ON \
		-DBUILD_EXAMPLES=OFF \
		-DBUILD_GAMES=OFF \
		-DUSE_WAYLAND=ON
	make -C build
}

package() {
	make -C build DESTDIR="$pkgdir" install

	for f in build/src/*.h; do
		install -Dm0644 "$f" "$pkgdir"/usr/include/"${f##*/}"
	done
}

sha512sums="f6e78a923b139907b81a544632e5fc574cd7b029a56e42b91e4b8df1be450a393fb421ab84c2e4c933051bb6ef6f526749e647008cad2f4198601f96797de4b8  raylib-wayland-3.0.0.tar.gz"
